// i18n配置
import { createI18n } from "vue-i18n";
import ch from "./ch";
import en from "./en";
import id from "./id";
import th from "./th";
import hi from "./hi";
import vi from "./vi";
const DOMAINS = [
  "id-list.pennyvibe.com",
  "id-ls.pennyvibe.com",
  "id-news.pennyvibe.com",
  "web3t.shengboglobal.com",
];

// 创建i18n
const i18n = createI18n({
  locale: DOMAINS.includes(location.hostname) ? location.hostname : "en",
  globalInjection: true, // 全局注入,可以直接使用$t
  // 处理报错: Uncaught (in promise) SyntaxError: Not available in legacy mode (at message-compiler.esm-bundler.js:54:19)
  legacy: false,
  messages: {
    ch,
    en,
    hi,
    "id-list.pennyvibe.com": id,
    th,
    vi,
  },
});
export default i18n;
